exports.search_detail = (req, res) => {

  var resultData = {};

  var restfulParams = req.routeInfo.restfulParams;

  //查询要审批的申请列表
  function searchProcessFlow(cb){

    R.SEND_HTTP(
      req,
      res,
      {
        url: CORE_APIConfig.coreAPI.processFlowSearch.Request_Api_Url + "/opf_id/" + restfulParams.opf_id,
        method: 'POST',
        data: {
          
        }
      },
      function (data) {


        resultData.processFlowData = data.result.data[0];

        cb();

      }
    )
  }

  //根据审批列表查询申请相关信息
  function searchApplyInfo(cb){


      R.SEND_HTTP(
        req,
        res,
        {
            url: CORE_APIConfig.coreAPI.applyProcessSearchInfo.Request_Api_Url + "/oap_id/" + resultData.processFlowData.opf_oapid,
            method : 'POST',
            data : {
              fields : [
                "oap_id",
                "oap_uid",
                "oap_process",
                "oap_create_time",
                "oap_status",
                "oap_content",
                "of_id",
                "of_name",
                "of_create_time",
                "of_is_used",
                "of_note",
                "of_uid",
                "u_id",
                "u_nickname"
              ].join(",")
            }
        },
        function (data) {        
           
          resultData.processFlowData.of_name = data.result.data[0].of_name;
          resultData.processFlowData.oap_content = data.result.data[0].oap_content;
          resultData.processFlowData.oap_create_time = data.result.data[0].oap_create_time;
          resultData.processFlowData.u_nickname = data.result.data[0].u_nickname;
          resultData.processFlowData.oap_uid = data.result.data[0].oap_uid;

          cb();

        }
      )


  }


  F.Serial([searchProcessFlow,searchApplyInfo], () => {

    //将最终结果返回给客户端
    RES.successResponse(res, resultData);

  })


}